package com.jason.accountmd.service.localacc;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.math.BigDecimal;


@LocalTCC
public interface ILocAccountServiceApi {

    @TwoPhaseBusinessAction(name = "LocAccountTccActionOne", commitMethod = "commitAccount", rollbackMethod = "rollbackAccount")
    public String addAmount(BusinessActionContext businessActionContext,
                            @BusinessActionContextParameter(paramName = "innerAccId") Long accId, @BusinessActionContextParameter(paramName = "amount") BigDecimal amount);

    public boolean commitAccount(BusinessActionContext businessActionContext);

    public boolean rollbackAccount(BusinessActionContext businessActionContext);
}
